As illustrated in FIG. 1, conventional MP3 encoders 10 employ four main components. A filter bank 12 is used to convert an input audio signal (in the time domain) to the frequency domain. A psychoacoustic model 16 is generally used to determine which components of the input signal can be removed (or transmitted with less accuracy) based on the characteristic of the human ear. A “bit allocator” (Bitstream formatting) 14 component calculates the quantization step size (QSS) of the input signal and other scale factors for each frequency band within the input signal. Broadly speaking, the bit allocator provides the output signal of the encoder with all of the non-important signal frequencies filtered out. The “bitstream formatter” (bitstream formatting) component 18 is the final component of the encoder which provides the signal that is suitable for transmission in compressed form (i.e. over the Internet).
The drawback with conventional encoders is that a tremendous amount of time is spent determining the quantization step size of the frequency components of the signal that is to be transmitted. As much as 30% of the encoding time is spent calculating the quantization step size. The longer the CPU is working, the more inefficient the encoding process is. Consequently, the conversion time from original audio formal to MP3 format is increased. What is needed is to reduce this large encoding time.
The QSS is determined by performing an iterative process. FIGS. 2 and 3 show iteration loops for the iterative process of the conventional encoders. FIG. 2 shows the conventional Outer Iteration Loop 20. A first step of Outer Iteration loop 20 is an inner iteration loop 24. Inner Iteration loop 24 is as shown on FIG. 3. In Step 26, the distortion for each critical band is calculated. In Step 28, the conventional method saves the scaling factors of the critical bands. Proceeding to Step 30, preemphasis is performed. In Step 32, the method amplifies critical bands with more than the allowed distortion. In Step 34, the determination is made whether all critical bands are amplified. If all critical bands are amplified, then Step 40 is performed wherein the scaling factors are restored. If all critical bands have not been amplified, then the loop proceeds to Step 36. In step 36, a determination is made whether the amplification of all bands is below the upper limit. If this is not true, then Step 40 is performed. If the amplification of all bands is below the upper limit, then the loop proceeds to Step 38. In Step 38, a determination is made as to whether there is at least one band with more than the allowed distortion. If there is not at least one such band, then Step 40 is performed. If there is at least one such band, then the loop proceeds back to Step 24.
FIG. 3 shows the conventional Inner Iteration Loop 24. Quantization is shown at Step 242. In step 244, there is a determination as to whether the maximum of all the quantized values are within the table range. If this is true, the loop proceeds to Step 246 wherein quantizer step size is increased, then proceeds back to the beginning of the loop. If the maximum of the quantized values is not within the table range in Step 244, then the loop proceeds to Step 248. In Step 248, the runlength of zeros at the upper end of the spectrum is calculated. Proceeding to Step 250, there is a calculation of the runlength of values less or equal one at the upper end of the spectrum. In Step 252, there is a bit count for the coding of values less or equal one on the upper end of the spectrum. In step 254, the rest of the spectral values are divided into three sub regions. In Step 256, the code table is chosen for each sub region. Proceeding to Step 258 there is a bit count for each sub region. In Step 260, a determination is made as to whether the overall bit sum is less than the available bit. If the overall bit sum is not less than the available bit, the loop proceeds to Step 262 where quantizer step size is increased before proceeding to the beginning of the loop at Step 242. If, for Step 260, the overall bit sum is less than the available bit, then the loop is completed and, at Step 264, there is a return back to the Outer Iteration Loop 20, shown in FIG. 2.